package com.multi.thread.chapter07.demo07;

public class ThreadGroupException {
	
	private static class MyThread extends Thread {
		private String num;

		public MyThread(ThreadGroup group, String name, String num) {
			super(group, name);
			this.num = num;
		}
		
		@SuppressWarnings("static-access")
		@Override
		public void run() {
			Integer.parseInt(num);
			while (this.interrupted() == true) {
				System.out.println("死循环中：" + Thread.currentThread().getName());
			}
		}
	}
	
	public static void main(String[] args) {
		MyThreadGroup group  = new MyThreadGroup("我的线程组");
		MyThread[] threadArray = new MyThread[10];
		for (int i = 0; i < threadArray.length; i++) {
			threadArray[i] = new MyThread(group, "线程" + (i + 1), "1");
			threadArray[i].start();
		}
		
		MyThread newThread = new MyThread(group, "报错的线程", "a");
		newThread.start();
	}

}
